package com.github.llyb120.testundertaker;

import com.github.llyb120.undertaker.TestApi;
import com.github.llyb120.undertaker.TestParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/user")
@RestController
public class UserCtrl {


    @TestApi(putContext = "id=${data.id}", order = 0)
    @RequestMapping("add")
    public UserAddDTO add(
            @RequestBody UserAddDTO userAddDTO
    ){
        //do save
        return userAddDTO;
    }


    @TestApi(order = 1)
    @RequestMapping("edit")
    public void edit(
            @RequestBody UserEditDTO userDTO
    ){
        //do edit
    }


    @TestApi(order = 2)
    @RequestMapping("delete")
    public void delete(
            @TestParam List<String> ids){
        //do delete

    }
}
